<script type="text/x-template" id="cc-json-schema-edit-el">
    <div>
        <json-editor ref="JsonEditor" :schema="schema" v-model="model">
            <button @click="submit">submit</button>
            <button @click="reset">Reset</button>
        </json-editor>
    </div>
</script>
<script>
    const SCHEMA = {
        type: 'object',
        title: 'vue-json-editor demo',
        properties: {
            name: {
                type: 'string',
            },
            email: {
                type: 'string',
            },
        },
    };
    Vue.component('cc-json-schema-edit-el', {
        template: '#cc-json-schema-edit-el',
        data() {
            return {
                schema: SCHEMA,
                // data
                model: {
                    name: 'Yourtion',
                },
            }
        },
        computed: {},
        props: {},
        watch: {},
        mounted() {

        }
        ,
        methods: {
            submit(_e) {
                alert(JSON.stringify(this.model));
            },
            reset() {
                this.$refs.JsonEditor.reset();
            },

        }
    })
</script>
